{include file="public:header" /}
<!--图片水印设置-->
<div class="pad_lr_10">
	<div class="col_tab">
		<ul class="J_tabs tab_but cu_li">
			<li class="current">水印设置</li>
		</ul>
		<div class="J_panes">
			<div class="content_list pad_10">
				<form id="info_form" action="{:url('Setting/editDo')}" method="post" enctype="multipart/form-data">
					<table width="100%" class="table_form">
						<tr>
							<th width="150">开启水印 :</th>
							<td>
								<label class="mr10"><input name="data[is_warter]" value="1" type="radio" class="J_change_status" {eq name="info['is_warter']" value="1"}checked{/eq}> 开启 </label>
								<label><input name="data[is_warter]" type="radio" value="0" class="J_change_status" {eq name="info['is_warter']" value="0"}checked{/eq}>关闭</label>
							</td>
						</tr>
						<tr>
							<th width="150">水印类型 :</th>
							<td>
								<label class="mr10"><input type="radio" name="data[water_type]" value="1" class="J_change_status" {eq name="info['water_type']" value="1"}checked{/eq}> 图片</label>
								<label><input type="radio" name="data[water_type]" value="2" class="J_change_status" {eq name="info['water_type']" value="2"}checked{/eq}> 文字</label>
							</td>
						</tr>
						<tr>
							<th>水印图片 :</th>
							<td>
								{notempty name="info['water_img']"}
								<img src="{$info.water_img}" width="100" alt="" style="background-color: #5ab431"><br />
								{/notempty}
								<input type="text" name="data[water_img]" id="J_img" class="input-text fl mr10" value="{$info.water_img}" size="40"/>
								&nbsp;&nbsp; <div id="J_upload_img" class="upload_btn"><span>上传</span></div></td>
						</tr>

						<tr>
							<th>水印文字 :</th>
							<td><input type="text" name="data[water_text]" class="input-text" value="{$info.water_text}" size="40" /></td>
						</tr>
						<tr>
							<th>水印透明度 :</th>
							<td><input type="text" name="data[water_alpha]" class="input-text" value="{$info.water_alpha}" size="30" /></td>
						</tr>
						<tr>
							<th>水印文字旋转角度 :</th>
							<td><input type="text" name="data[water_angle]" class="input-text" value="{$info.water_angle}" size="30" /></td>
						</tr>
						<tr>
							<th>水印文字大小 :</th>
							<td><input type="text" name="data[water_size]" class="input-text" value="{$info.water_size}" size="30" /></td>
						</tr>
						<tr>
							<th>水印文字颜色 :</th>
							<td><input type="text" name="data[water_color]" id="J_color" class="input-text" value="{$info.water_color}" size="30" />&nbsp;<a href="javascript:;" class="color_picker_btn"><img class="J_color_picker" data-it="J_title" data-ic="J_color" src="__IMG__/color.png"></a></td>
						</tr>
						<tr>
							<th>水印位置 :</th>
							<td>
								<table width="300" border="0">
									<tr>
										<td><label><input name="data[water_pos]" type="radio" value="1" {eq name="info['water_pos']" value="1"}checked{/eq}/>顶部居左</label></td>
										<td><label><input name="data[water_pos]" type="radio" value="2" {eq name="info['water_pos']" value="2"}checked{/eq}/>顶部居中</label></td>
										<td><label><input name="data[water_pos]" type="radio" value="3" {eq name="info['water_pos']" value="3"}checked{/eq}/>顶部居右</label></td>
									</tr>
									<tr>
										<td><label><input name="data[water_pos]" type="radio" value="4" {eq name="info['water_pos']" value="4"}checked{/eq}/>左边居中</label></td>
										<td><label><input name="data[water_pos]" type="radio" value="5" {eq name="info['water_pos']" value="5"}checked{/eq}/>图片中心</label></td>
										<td><label><input name="data[water_pos]" type="radio" value="6" {eq name="info['water_pos']" value="6"}checked{/eq}/>右边居中</label></td>
									</tr>
									<tr>
										<td><label><input name="data[water_pos]" type="radio" value="7" {eq name="info['water_pos']" value="7"}checked{/eq}/>底部居左</label></td>
										<td><label><input name="data[water_pos]" type="radio" value="8" {eq name="info['water_pos']" value="8"}checked{/eq}/>底部居中</label></td>
										<td><label><input name="data[water_pos]" type="radio" value="9"  {eq name="info['water_pos']" value="9"}checked{/eq} />底部居右</label></td>
									</tr>
								</table>
							</td>
						</tr>
						<tr>
							<th></th>
							<td>
								<input type="hidden" name="name" value="{$action_name}">
								<input type="hidden" name="id" value="{$base.id}">
								<input type="submit" class="btn btn_submit" value="提交"/>
							</td>
						</tr>
					</table>
				</form>
			</div>
		</div>
	</div>
</div>
{include file="public:footer" /}
<script src="__PUBLIC__/js/plugins/colorpicker.js"></script>
<script src="__PUBLIC__/js/plugins/fileuploader.js"></script>
<script type="text/javascript">
	$(function(){
		$('.J_color_picker').colorpicker();
		//上传图片
		var img_uploader = new qq.FileUploaderBasic({
			allowedExtensions: ['jpg','gif','jpeg','png'],
			button: document.getElementById('J_upload_img'),
			multiple: false,
			action: "{:url('Setting/ajaxUploadImg')}",
			inputName: 'img',
			forceMultipart: true, //用$_FILES
			showMessage: function(message){
				$.yingloujie.tip({content:message, icon:'error'});
			},
			onSubmit: function(id, fileName){
				$('#J_upload_img').addClass('btn_disabled').find('span').text('上传中...');
			},
			onComplete: function(id, fileName, result){
				$('#J_upload_img').removeClass('btn_disabled').find('span').text('上传');
				if(result.status == '1'){
					$('#J_img').val(result.data);
				} else {
					$.yingloujie.tip({content:result.msg, icon:'error'});
				}
			}
		});
	});

</script>
</body>
</html>